package com.example.xksys.controller;

import com.example.xksys.service.imp.AdminOperatorServiceImpl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/admin")
public class AdminOperationController {
    @Resource
    private AdminOperatorServiceImpl adminOperatorServiceImpl;
    @RequestMapping("/login")
    public Integer login(@RequestParam Map<String,String> map){

        return adminOperatorServiceImpl.Login(map);
    }
    @RequestMapping("/addC")
    public Integer insertC(@RequestParam Map<String,String> map){
        return adminOperatorServiceImpl.InsertC(map);
    }
    @RequestMapping("/delC")
    public Integer deleteC(@RequestParam Map<String,String> map){
        return adminOperatorServiceImpl.deleteCById(map);
    }
    @RequestMapping("/search")
    public List<Map<String,Object>> searchAll(@RequestParam Map<String,Object> map){
    return adminOperatorServiceImpl.selectAll(map);
    }
    @RequestMapping("/update")
    public Integer updateByKey(@RequestParam Map<String,String>map)
    {
        return adminOperatorServiceImpl.update(map);
    }
}
